
package guice.boot.archive.container.pipeline;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import guice.boot.archive.exception.ArkRuntimeException;
import guice.boot.archive.spi.pipeline.PipelineContext;
import guice.boot.archive.spi.pipeline.PipelineStage;
import guice.boot.archive.spi.service.classloader.ClassLoaderService;
import guice.boot.archive.spi.service.plugin.PluginDeployService;


@Singleton
public class DeployPluginStage implements PipelineStage {

    @Inject
    private ClassLoaderService classloaderService;

    @Inject
    private PluginDeployService pluginDeployService;

    @Override
    public void process(PipelineContext pipelineContext) throws ArkRuntimeException {
        classloaderService.prepareExportClassAndResourceCache();
        pluginDeployService.deploy();
    }

}